package com.quanxi.qxaimain.controller.v1.forVueController;

import com.quanxi.qxaimain.dao.indicators.indicatorsDataMapper;
import com.sargeraswang.util.ExcelUtil.ExcelLogs;
import com.sargeraswang.util.ExcelUtil.ExcelUtil;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author lyx
 * @create 2023/2/17 15:37
 * vue接口
 */

@Slf4j
@RestController
@RequestMapping("/fileManage")
@Api(tags = "文件管理")
public class fileManageController {

  @Resource
   indicatorsDataMapper indicatorsDataMapper;
    @PostMapping("/search")
        public Object search(String filename){

        String sql ="select \n" +
                "id,\n" +
                "fileid,\n" +
                "filename,\n" +
                "publish_time,\n" +
                "version,\n" +
                "date_format(upload_time,'%Y-%m-%d %H:%i:%s') as upload_time,\n" +
                "editor,\n" +
                "sqlSelect,\n" +
                "sqlInsert,\n" +
                "tablename  \n" +
                "from  qx_t_file  ORDER BY upload_time desc ";

        List<LinkedHashMap<String, Object>> mapList = indicatorsDataMapper.exec_sql2(sql);
      //  indicatorsDataMapper.exec_sql2("select id, filename ,version,date_format(upload_time,'%Y-%m-%d %H:%i:%s') as upload_time,editor   from  qx_t_file ORDER BY upload_time desc");
        return mapList;
    }






}